package mul.Logic;

import java.util.TimerTask;

public class LevelTimer extends TimerTask {
	
	private GameState gs;
	
	public LevelTimer(GameState gs) {
		this.gs = gs;
	}
	
	public void run() {
		if(!gs.isLevelCountdown()) {
			if(gs.getTimeleft() > 0)
				gs.decrementTimeleft();

			if(gs.getTimeleft() == 0)
				gs.levelNext();
		}
	}
	
}
